home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _75EAB196A2274BB68B7ECCFB2DE49D32 < prev    next >
Encoding:
Text File  |  2004-01-06  |  1.1 KB  |  32 lines

  1.       #include "../CGVPMacro.csi"
  2.  
  3.       MainInput { uniform samplerCUBE refrMapR : texunit0,
  4.                   uniform samplerCUBE refrMapG : texunit1,
  5.                   uniform samplerCUBE refrMapB : texunit2,
  6.                   uniform samplerCUBE reflMap : texunit3,
  7.                   uniform float4 Opacity }
  8.       DeclarationsScript
  9.       {
  10.         OUT_T0_T1_T2_T3_C0
  11.         FOUT
  12.       }
  13.       CoreScript
  14.       {
  15.         // load the reflection map
  16.         float4 reflColor = texCUBE(reflMap, IN.Tex3.xyz);
  17.         // load the refraction map
  18.         float3 cubeR = texCUBE(refrMapR, IN.Tex0.xyz).xyz;
  19.         float3 cubeG = texCUBE(refrMapG, IN.Tex1.xyz).xyz;
  20.         float3 cubeB = texCUBE(refrMapB, IN.Tex2.xyz).xyz;
  21.         float3 refrColor;
  22.         refrColor.r = cubeR.r;
  23.         refrColor.g = cubeG.g;
  24.         refrColor.b = cubeB.b;
  25.         float3 env = reflColor.xyz*IN.Color.xyz + refrColor.xyz*(1-IN.Color.xyz);
  26.         // finally add them all together
  27.         OUT.Color.xyz = env.xyz;
  28.         OUT.Color.w = Opacity.a * IN.Color.a;
  29.       }
  30.  
  31.  
  32.